package com.yuyou.tas.feedback.service;

import com.yuyou.tas.service.api.admin.entity.CommJob;
import com.yuyou.tas.service.api.feedback.dto.FeedbackListDTO;
import com.yuyou.tas.service.api.feedback.entity.Feedback;
import com.yuyou.tas.service.api.feedback.entity.FeedbackNote;
import com.yuyou.tas.service.api.feedback.entity.FeedbackSituation;
import com.yuyou.tas.service.api.feedback.vo.req.FeedBackEditReqVo;
import com.yuyou.tas.service.api.feedback.vo.resp.FeedbackNameResp;
import com.yuyou.tas.service.api.feedback.vo.resp.StudentFeedBackEdit;
import com.yuyou.tas.util.bean.Pagination;
import com.yuyou.tas.util.bean.ResBoolSimpleInfo;
import org.apache.poi.hssf.usermodel.HSSFWorkbook;

import java.util.List;

public interface IFeedbackService {
    int deleteByPrimaryKey(Long id);

    int insert(Feedback record);

    Feedback selectByPrimaryKey(Long id);

    int updateByPrimaryKeySelective(Feedback record);

    /**
     * 反馈总数
     * @param queryPgn
     * @return
     */
    int findFeedbackCount(Pagination<FeedbackListDTO> queryPgn);

    /**
     * 反馈列表
     * @param queryPgn
     * @return
     */
    List<FeedbackListDTO> feedbackList(Pagination<FeedbackListDTO> queryPgn);

    /**
     * 更新/添加反馈
     * @param vo
     * @return
     */
    ResBoolSimpleInfo<Feedback> addOrUpdateFeedbackService(FeedBackEditReqVo vo);

    /**
     * 批量发布
     * @param feedbackClassId
     * @return
     */
    ResBoolSimpleInfo<String> batchPublish(Long feedbackClassId);

    /**
     * 学生反馈详情
     * @param feedbackClassId
     * @param classId
     * @return
     */
    List<StudentFeedBackEdit> findStuDetailByFeedClassId(Long feedbackClassId , Long classId);

    void insert2Job(List<FeedbackSituation> feedbacks , List<FeedbackNote> feedbackNotes);

    void AsynUploadJob(CommJob commJob);

    /**
     * 反馈统计
     * @param baseSchoolIds
     * @param baseTrimesterId
     * @param baseSectionIds
     * @param dataSubjectIds
     * @return
     */
    HSSFWorkbook feedbackStatis(List<Long> baseSchoolIds, Long baseTrimesterId, List<Long> baseSectionIds, List<Long> dataSubjectIds);

    /**
     * 拿反馈名称
     * @param feedbackId
     * @return
     */
    FeedbackNameResp getFeedbackName(Long feedbackId);

    /**
     * 设置某一反馈下的回复内容为已读
     * @param feedbackId
     */
    void set2Read(Long feedbackId , Long userId);
}